/*
 * @Author: kanglang
 * @Date: 2021-02-09 14:00:20
 * @LastEditors: 汪滔
 * @LastEditTime: 2021-03-01 16:15:39
 * @Description: 地址管理
 */

import { fetchGet, fetchPost, fetchDel, fetchPut, fetchPostImg, fetchPostUrl } from '../config';
// 地址管理

export default {
  // 新增地址
  addAddress(params) {
    return fetchPost('user-api/api/v1/address/addUserAddress', params);
  },
  // 新增地址
  editAddress(params, isAdd) {
    return fetchPost(`user-api/api/v1/address/${isAdd ? 'addUserAddress' : 'editUserAddress'}`, params);
  },
  // 删除地址
  deleteAddress(params) {
    return fetchGet('user-api/api/v1/address/delUserAddress', params);
  },
  // 列表
  getAddressList(params) {
    return fetchGet('user-api/api/v1/address/getUserAddressList', params);
  },
  // 新列表  https://api-test.guojutech.net/api/data-view/public/address/parent-code?parentCode=0
  getAddressListNew(params) {
    return fetchGet('api/data-view/public/address/parent-code', params);
  },
  // 新增地址B2B
  addAddressB2B(params) {
    return fetchPost('user-api/api/v1/legalAddress/addUserAddress', params);
  },
  // 修改地址B2B
  editAddressB2B(params,) {
    return fetchPost('user-api/api/v1/legalAddress/editUserAddress', params);
  },
  // 删除地址B2B
  deleteAddressB2B(params) {
    return fetchGet('user-api/api/v1/legalAddress/delUserAddress', params);
  },
  // 列表B2B
  getAddressListB2B(params) {
    return fetchGet('user-api/api/v1/legalAddress/getUserAddressList', params);
  },

};
